<template>
	<div class="seller-product-view">
		<div class="head-container">
			<div class="seller-logo">
				<el-image
									style="width: 100%; height: 100%"
									:src="seller.logo"
									fit="none"></el-image>
			</div>
			<div class="seller-info">
				<div class="title">{{seller.name}}</div>
				<div class="fullname">
					公司全称：
					<span>{{seller.fullname}}</span>
					<svg t="1641525404093" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4067" width="40" height="40"><path d="M336 976H209.1l-1.1-33.39C208 810.83 344.11 704 512 704s304 106.83 304 238.61L814.9 976H336z" fill="#231E37" p-id="4068"></path><path d="M822.64 984H201.36L200 942.61c0-66.24 32.71-128.4 92.1-175C350.92 721.43 429 696 512 696s161.08 25.43 219.9 71.59c59.39 46.62 92.1 108.78 92.1 175v0.26z m-605.8-16h590.32l0.84-25.52C807.9 815.38 675.16 712 512 712S216.1 815.38 216 942.48z" fill="#222222" p-id="4069"></path><path d="M512 976L400 720h224L512 976z" fill="#FFFFFF" p-id="4070"></path><path d="M512 984a8 8 0 0 1-7.33-4.79l-112-256A8 8 0 0 1 400 712h224a8 8 0 0 1 7.33 11.21l-112 256A8 8 0 0 1 512 984z m-99.77-256L512 956l99.77-228z" fill="#222222" p-id="4071"></path><path d="M560 624h-96v90s0 86 48 86 48-86 48-86z" fill="#FFCEBF" p-id="4072"></path><path d="M512 808c-16.46 0-38.44-8.47-49.71-48.85A188.19 188.19 0 0 1 456 714v-98h112v98a188.19 188.19 0 0 1-6.29 45.15C550.44 799.53 528.46 808 512 808z m-40-176v82c0 0.78 0.55 78 40 78 15.88 0 27.42-12.5 34.29-37.15A173.86 173.86 0 0 0 552 714v-82z" fill="#222222" p-id="4073"></path><path d="M448 832l-48-112 48-16 64 96-64 32z" fill="#FFFFFF" p-id="4074"></path><path d="M448 840a8 8 0 0 1-7.35-4.85l-48-112a8 8 0 0 1 4.82-10.74l48-16a8 8 0 0 1 9.19 3.15l64 96a8 8 0 0 1-3.08 11.6l-64 32a8 8 0 0 1-3.58 0.84z m-37.22-115.16L452 821.05l48.31-24.15-55.59-83.38z" fill="#222222" p-id="4075"></path><path d="M384 768l-64-16 80-32 112 256-160-176 32-32z" fill="#31486A" p-id="4076"></path><path d="M512 984a8 8 0 0 1-5.92-2.62l-160-176a8 8 0 0 1 0.26-11l22-22-50.29-12.57a8 8 0 0 1-1-15.19l80-32a8 8 0 0 1 10.3 4.22l112 256A8 8 0 0 1 512 984zM363.05 800.26l122.09 134.3-89.36-204.25-49.84 19.93 40 10a8 8 0 0 1 3.72 13.42z" fill="#222222" p-id="4077"></path><path d="M640 768l64-16-80-32-112 256 160-176-32-32z" fill="#31486A" p-id="4078"></path><path d="M512 984a8 8 0 0 1-7.33-11.21l112-256a8 8 0 0 1 10.3-4.22l80 32a8 8 0 0 1-1 15.19l-50.29 12.57 22 22a8 8 0 0 1 0.26 11l-160 176A8 8 0 0 1 512 984z m116.22-253.69l-89.36 204.25L661 800.26l-26.61-26.6a8 8 0 0 1 3.72-13.42l40-10z" fill="#222222" p-id="4079"></path><path d="M576 832l48-112-48-16-64 96 64 32z" fill="#FFFFFF" p-id="4080"></path><path d="M576 840a8 8 0 0 1-3.58-0.84l-64-32a8 8 0 0 1-3.08-11.6l64-96a8 8 0 0 1 9.19-3.15l48 16a8 8 0 0 1 4.82 10.74l-48 112A8 8 0 0 1 576 840z m-52.32-43.1L572 821.05l41.23-96.21-34-11.32z" fill="#222222" p-id="4081"></path><path d="M800 560s-102.86 82.29-288 82.29S224 560 224 560s41.14-2.29 41.14-53.71V341.71h493.72v144C758.86 537.14 800 560 800 560z" fill="#AA6E50" p-id="4082"></path><path d="M512 650.29c-97 0-171.28-22.72-216.53-41.77-49.32-20.77-75.38-41.4-76.47-42.27a8 8 0 0 1 4.56-14.25 37.46 37.46 0 0 0 17.05-6.57c11-7.77 16.53-20.94 16.53-39.15V341.71a8 8 0 0 1 8-8h493.72a8 8 0 0 1 8 8v144c0 45.87 35.54 66.46 37 67.31a8 8 0 0 1 1.14 13.23c-1.09 0.87-27.15 21.5-76.47 42.27C683.28 627.57 609 650.29 512 650.29z m-269.84-87.41A393.38 393.38 0 0 0 302.32 594C346.11 612.4 418 634.29 512 634.29S677.89 612.4 721.68 594c31.43-13.18 53.27-26.47 64.51-34-13.34-10.88-35.33-34.8-35.33-74.31v-136H273.14v156.6c0 34.71-17.06 49.93-30.98 56.59z" fill="#222222" p-id="4083"></path><path d="M509.43 595.43c-43.67 0-66.08-10.95-67-11.42a8 8 0 0 1 7.13-14.32c0.35 0.17 20.55 9.74 59.88 9.74 39.93 0 59.65-9.63 59.85-9.73a8 8 0 1 1 7.14 14.3c-0.93 0.48-23.33 11.43-67 11.43zM379.93 489.73c-61.25 0-111.07-43.9-111.07-97.86 0-16.15 4.36-28.36 13.33-37.32 18.39-18.36 52.13-18.31 91.21-18.26h13.05c39.09 0 72.83-0.1 91.22 18.26 9 9 13.33 21.17 13.33 37.32 0 53.96-49.83 97.86-111.07 97.86z m-12.86-137.44c-32.81 0-60.7 0.73-73.57 13.59-5.82 5.8-8.64 14.3-8.64 26 0 45.14 42.65 81.86 95.07 81.86S475 437 475 391.87c0-11.69-2.83-20.19-8.64-26-13.69-13.68-44.39-13.65-79.88-13.59h-19.41zM638.93 489.73c-61.25 0-111.07-43.9-111.07-97.86 0-16.15 4.36-28.36 13.33-37.32 18.39-18.36 52.14-18.31 91.21-18.26h13.05c39.09 0 72.83-0.1 91.22 18.26 9 9 13.33 21.17 13.33 37.32 0 53.96-49.83 97.86-111.07 97.86z m-12.86-137.44c-32.81 0-60.7 0.73-73.57 13.59-5.82 5.8-8.64 14.3-8.64 26 0 45.14 42.65 81.86 95.07 81.86S734 437 734 391.87c0-11.69-2.83-20.19-8.64-26-13.7-13.68-44.38-13.65-79.88-13.59h-19.41z" p-id="4084"></path><path d="M480 896l16-80 16-16 16 16 16 80-32 64-32-64z" fill="#231E37" p-id="4085"></path><path d="M512 977.89l-40.38-80.77 17-85.06L512 788.69l23.37 23.37 17 85.06z m-23.62-83L512 942.11l23.62-47.23-15-74.94-8.62-8.63-8.63 8.63z" fill="#222222" p-id="4086"></path><path d="M624 896h32v32h-32z" fill="#FFBE00" p-id="4087"></path><path d="M656 936h-32a8 8 0 0 1-8-8v-32a8 8 0 0 1 8-8h32a8 8 0 0 1 8 8v32a8 8 0 0 1-8 8z m-24-16h16v-16h-16z" fill="#222222" p-id="4088"></path><path d="M656 896h32v32h-32z" fill="#FFBE00" p-id="4089"></path><path d="M688 936h-32a8 8 0 0 1-8-8v-32a8 8 0 0 1 8-8h32a8 8 0 0 1 8 8v32a8 8 0 0 1-8 8z m-24-16h16v-16h-16z" fill="#222222" p-id="4090"></path><path d="M688 896h32v32h-32z" fill="#FFBE00" p-id="4091"></path><path d="M720 936h-32a8 8 0 0 1-8-8v-32a8 8 0 0 1 8-8h32a8 8 0 0 1 8 8v32a8 8 0 0 1-8 8z m-24-16h16v-16h-16z" fill="#222222" p-id="4092"></path><path d="M352 928l-16-32h-48l16 32h48z" fill="#FFBE00" p-id="4093"></path><path d="M352 936h-48a8 8 0 0 1-7.16-4.42l-16-32A8 8 0 0 1 288 888h48a8 8 0 0 1 7.16 4.42l16 32A8 8 0 0 1 352 936z m-43.06-16h30.12l-8-16h-30.12z" fill="#222222" p-id="4094"></path><path d="M336 780.43l-32-16.23-66.3 51.56 32 16.24 66.3-51.57z" fill="#FFBE00" p-id="4095"></path><path d="M269.7 840a8 8 0 0 1-3.62-0.87l-32-16.23a8 8 0 0 1-1.29-13.45l66.3-51.57a8 8 0 0 1 8.53-0.82l32 16.24a8 8 0 0 1 1.29 13.45l-66.3 51.56a7.94 7.94 0 0 1-4.91 1.69z m-17.13-25.67l16.23 8.24 52.33-40.71-16.22-8.23z" fill="#222222" p-id="4096"></path><path d="M688 780.43l32-16.23 66.3 51.56-32 16.24-66.3-51.57z" fill="#FFBE00" p-id="4097"></path><path d="M754.3 840a7.94 7.94 0 0 1-4.91-1.69l-66.3-51.56a8 8 0 0 1 1.29-13.45l32-16.24a8 8 0 0 1 8.53 0.82l66.3 51.57a8 8 0 0 1-1.29 13.45l-32 16.23a8 8 0 0 1-3.62 0.87z m-51.43-58.14l52.33 40.71 16.23-8.24-52.34-40.7z" fill="#222222" p-id="4098"></path><path d="M352 928l16-32h48l-16 32h-48z" fill="#FFBE00" p-id="4099"></path><path d="M400 936h-48a8 8 0 0 1-7.16-11.58l16-32A8 8 0 0 1 368 888h48a8 8 0 0 1 7.16 11.58l-16 32A8 8 0 0 1 400 936z m-35.06-16h30.12l8-16h-30.12z" fill="#222222" p-id="4100"></path><path d="M282.15 411.84m-58.15 0a58.15 58.15 0 1 0 116.3 0 58.15 58.15 0 1 0-116.3 0Z" fill="#FFCEBF" p-id="4101"></path><path d="M282.15 478a66.15 66.15 0 1 1 66.15-66.15A66.22 66.22 0 0 1 282.15 478z m0-116.29a50.15 50.15 0 1 0 50.15 50.14 50.2 50.2 0 0 0-50.15-50.15z" fill="#222222" p-id="4102"></path><path d="M741.85 411.84m-58.15 0a58.15 58.15 0 1 0 116.3 0 58.15 58.15 0 1 0-116.3 0Z" fill="#FFCEBF" p-id="4103"></path><path d="M741.85 478A66.15 66.15 0 1 1 808 411.84 66.23 66.23 0 0 1 741.85 478z m0-116.29A50.15 50.15 0 1 0 792 411.84a50.2 50.2 0 0 0-50.15-50.14z" fill="#222222" p-id="4104"></path><path d="M742 312.6l0.84 111.7c0 136.84-104.13 247.77-232.59 247.77S277.69 561.14 277.69 424.3l0.84-111.7S288 96 512 96s230 216.6 230 216.6z" fill="#FFCEBF" p-id="4105"></path><path d="M510.29 680.07c-64.37 0-124.85-26.67-170.29-75.07s-70.31-112.48-70.31-180.7l0.85-112c0.1-2.29 2.8-56.69 33.75-111.86 18.29-32.63 42.68-58.64 72.48-77.32C413.88 99.8 459.38 88 512 88s98 11.8 134.72 35.08c29.54 18.71 53.53 44.74 71.33 77.39 30.08 55.2 31.92 109.62 32 111.91v0.16l0.84 111.7c0 68.28-25 132.45-70.29 180.74s-105.95 75.09-170.31 75.09zM286.53 312.83l-0.84 111.53c0 132.15 100.75 239.71 224.6 239.71S734.88 556.51 734.88 424.3L734 312.76c-0.08-2.12-2.33-54.09-30.32-105.14C666 138.86 601.51 104 512 104s-154.65 34.89-193.47 103.71c-28.59 50.67-31.84 102.29-32 105.12z" fill="#222222" p-id="4106"></path><path d="M298.84 469.99a37 21.15 0 1 0 74 0 37 21.15 0 1 0-74 0Z" fill="#FFA096" p-id="4107"></path><path d="M647.73 469.99a37 21.15 0 1 0 74 0 37 21.15 0 1 0-74 0Z" fill="#FFA096" p-id="4108"></path><path d="M407.66 372.19l-8.2 8.2a31.89 31.89 0 0 0-8-3.34v-11.59a8 8 0 0 0-16 0v11.59a31.82 31.82 0 0 0-8 3.34l-8.2-8.2a8 8 0 0 0-11.32 11.32l8.21 8.2a31.72 31.72 0 1 0 54.71 0l8.2-8.2a8 8 0 0 0-11.31-11.32zM672.72 372.19a8 8 0 0 0-11.32 0l-8.2 8.2a31.67 31.67 0 0 0-8-3.34v-11.59a8 8 0 1 0-16 0v11.59a31.89 31.89 0 0 0-8 3.34l-8.2-8.2a8 8 0 0 0-11.31 11.32l8.2 8.2a31.72 31.72 0 1 0 54.72 0l8.2-8.2a8 8 0 0 0-0.09-11.32z" fill="#222222" p-id="4109"></path><path d="M446.85 576.92s21.15 10.57 63.44 10.57 63.43-10.57 63.43-10.57" fill="#FFCEBF" p-id="4110"></path><path d="M510.29 595.49c-43.68 0-66.09-11-67-11.42a8 8 0 0 1 7.13-14.32c0.28 0.13 20.48 9.74 59.89 9.74s59.69-9.65 59.89-9.75a8 8 0 0 1 7.12 14.33c-0.95 0.47-23.32 11.42-67.03 11.42z" fill="#222222" p-id="4111"></path><path d="M848 258.22c0 83.3-150.43 93.78-336 93.78s-336-10.48-336-93.78S326.43 32 512 32s336 142.93 336 226.22z" fill="#231E37" p-id="4112"></path><path d="M512 360c-81.79 0-174.18-1.88-239.26-15.83C202.26 329.06 168 301 168 258.22c0-22.2 9.61-48.12 27.78-75 18-26.56 43.51-52.76 73.8-75.75C310.67 76.32 396.81 24 512 24s201.33 52.32 242.42 83.5c30.29 23 55.81 49.19 73.8 75.75C846.39 210.1 856 236 856 258.22c0 42.73-34.26 70.84-104.74 85.95C686.18 358.12 593.79 360 512 360z m0-320c-110.51 0-193.26 50.28-232.75 80.25-57.86 43.91-95.25 98.07-95.25 138 0 17.54 7.59 31.73 23.19 43.39 15.15 11.31 38.33 20.36 68.9 26.92C339.71 342.16 431.05 344 512 344s172.29-1.84 235.91-15.47c30.57-6.56 53.75-15.61 68.9-26.92C832.41 290 840 275.76 840 258.22c0-39.9-37.39-94.06-95.25-138C705.26 90.28 622.51 40 512 40z" fill="#222222" p-id="4113"></path><path d="M272 312a240 56 0 1 0 480 0 240 56 0 1 0-480 0Z" fill="#231E37" p-id="4114"></path><path d="M512 376c-64.7 0-125.62-5.9-171.52-16.61C289.73 347.55 264 331.6 264 312s25.73-35.55 76.48-47.39C386.38 253.9 447.3 248 512 248s125.62 5.9 171.52 16.61C734.27 276.45 760 292.4 760 312s-25.73 35.55-76.48 47.39C637.62 370.1 576.7 376 512 376z m0-112c-63.51 0-123.14 5.75-167.89 16.19C293.5 292 280 305.74 280 312s13.5 20 64.11 31.81C388.86 354.25 448.49 360 512 360s123.14-5.75 167.89-16.19C730.5 332 744 318.26 744 312s-13.5-20-64.11-31.81C635.14 269.75 575.51 264 512 264z" fill="#222222" p-id="4115"></path><path d="M768 287.25c0 46.85-114.62 0.75-256 0.75s-256 46.1-256-0.75S370.62 160 512 160s256 80.4 256 127.25z" fill="#31486A" p-id="4116"></path><path d="M732.2 316.27c-18.61 0-42.86-3.35-72.53-7.45C618.36 303.11 566.93 296 512 296s-106.36 7.11-147.67 12.82c-55.12 7.62-91.53 12.65-107.87-1.59-5.61-4.89-8.46-11.61-8.46-20 0-27.06 30.3-60.85 79.07-88.17C358.45 181.5 424.2 152 512 152s153.55 29.5 184.93 47.08C745.7 226.4 776 260.19 776 287.25c0 8.37-2.85 15.09-8.46 20-7.54 6.56-19.37 9.02-35.34 9.02zM512 280c56 0 108.06 7.19 149.87 13 45.24 6.26 84.31 11.66 95.16 2.2 1.38-1.21 3-3.19 3-7.92 0-17.17-21.92-46.78-70.89-74.21-30-16.82-93-45-177.11-45s-147.09 28.22-177.11 45c-49 27.43-70.89 57-70.89 74.21 0 4.73 1.59 6.71 3 7.92 10.85 9.46 49.92 4.06 95.16-2.2 41.75-5.81 93.81-13 149.81-13z" fill="#222222" p-id="4117"></path><path d="M752 320s-47.25-80-240-80-240 80-240 80v16s47.25-48 240-48 240 48 240 48z" fill="#FFBE00" p-id="4118"></path><path d="M752 344a8 8 0 0 1-5.7-2.39c-0.06-0.05-12-11.45-46.69-22.73C667.51 308.44 608.91 296 512 296c-98.49 0-157.55 12.83-189.75 23.59-33.16 11.08-44.44 21.92-44.55 22A8 8 0 0 1 264 336v-16a8 8 0 0 1 1.11-4.07c0.53-0.89 13.35-22.1 50.72-42.92 33.58-18.71 94.88-41 196.17-41s162.59 22.3 196.17 41c37.37 20.82 50.19 42 50.72 42.92A8 8 0 0 1 760 320v16a8 8 0 0 1-8 8z m-240-96c-158.11 0-215.53 54.4-229.47 71.2C309.42 304.33 374.45 280 512 280s202.47 24.29 229.41 39.16c-5.75-6.88-18.68-20-42.39-32.93C667.15 268.79 608.84 248 512 248z" fill="#222222" p-id="4119"></path><path d="M576 144c0 35.35-28.65 80-64 80s-64-44.65-64-80 28.65-48 64-48 64 12.65 64 48z" fill="#FFBE00" p-id="4120"></path><path d="M512 232c-39.88 0-72-48.14-72-88 0-35.59 26.24-56 72-56s72 20.41 72 56c0 39.86-32.12 88-72 88z m0-128c-17.31 0-31.44 3.26-40.87 9.44C461 120.1 456 130.1 456 144c0 15.66 6.58 34.24 17.17 48.48 11.1 15 25.26 23.52 38.83 23.52s27.73-8.57 38.83-23.52C561.42 178.24 568 159.66 568 144c0-13.9-5-23.9-15.13-30.56-9.43-6.18-23.56-9.44-40.87-9.44z" fill="#222222" p-id="4121"></path></svg>
				</div>
				<br>
				<br>
				<el-button type="success" size="mini">
					<i class="el-icon-star-off"></i> 收藏
				</el-button>
			</div>
		</div>

		<div class="body-container">
			<div class="mod-promo">
				<div class="mod-hd">
					<nav-bar>
						<div slot = "left-slot" class="nav-left">全部产品</div>
						<div slot = "right-slot" class="nav-right">共{{initSellerAllProduct.length}}条</div>
					</nav-bar>
					<div class="mod-bd">
						<div class="bd-item" v-for="(item,index) in sellerAllProductData" :key="index">
							<list-item>
								<div slot = "left-slot">
									<el-image class="hvr-grow"
														@click="$router.push('/travelnote/'+ item.id)"
														style="width: 100%; height: 100%"
														:src="item.routePhoto.split(',')[0]"
														fit="none"></el-image>
								</div>

								<div slot="right-slot">
									<div class="title hvr-underline-from-center"
											 @click="$router.replace('/trips/'+item.id)">{{item.title}}</div>
									<div class="price-buy">
										<span>￥{{item.price}}起</span>
										<span class="my-right">
										<el-button type="warning" round v-if="item.flag == 1"
															 @click="$router.replace('/trips/'+item.id)">立即预定</el-button>
										<el-button type="info" round v-else
															 disabled>已下架</el-button>
									</span>
									</div>
									<div class="view-count">
										<i class="el-icon-star-off"></i>
										{{item.counts}}</div>
								</div>
							</list-item>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
</template>

<script>
	import NavBar from "@/components/navbar/NavBar.vue";
	import ListItem from "@/components/list-item/ListItem";

	export default {
		name: "SellerProduct",
		components:{
			NavBar,
			ListItem,
		},
		data(){
			return{
				seller: {},
				sellerAllProductData:[],
			}
		},
		methods:{
			initSellerAllProduct(seller_id){
				this.$getRequest("/route/allRouteBySellerId?seller_id="+seller_id).then(res =>{
					console.log(res);
					if(res.data.status === 200){
						this.sellerAllProductData.splice(0)
						this.sellerAllProductData.push(...res.data.obj)
					}
				})
			},
			initSellerInfo(seller_id){
				this.$getRequest("/seller/id?seller_id="+seller_id).then(res =>{
					console.log(res);
					if(res.data.status === 200){
						this.seller = res.data.obj;
					}
				})
			}
		},
		created() {
			console.log(this.$route);
			let seller_id = this.$route.params.id

			this.initSellerAllProduct(seller_id);
			this.initSellerInfo(seller_id);
		}
	}
</script>

<style lang="less" scoped>
	.head-container{
		display: flex;
		.seller-logo{
			width: 200px;
			height: 200px;
			border: 1px solid #ddd;
		}
		.seller-info{
			flex: 1;
			margin-left: 20px;
			.title{
				line-height: 50px;
				font-weight: bold;
				font-size: 28px;
			}
			.fullname{
				line-height: 50px;
				font-size: 20px;
			}
		}
	}

	.body-container{
		.mod-promo{
			margin-top: 20px;
			.mod-hd{
				border-bottom: 1px solid #eee;
				.nav-left{
					border-left: 4px solid #fd8a4d;
					padding-left: 10px;
				}
				.nav-right{
					font-size: 22px;
					color: rgba(32, 152, 209,1);
				}
			}
			.bd-item{
				padding: 15px 10px;
				border-bottom: 1px dashed #ddd;
				&:hover{
					background-color: #eee;
				}
				.title{
					font-size: 24px;
					line-height: 60px;
					width: 100%;
					text-overflow: ellipsis;
					white-space: nowrap;
					overflow-x: hidden;
				}
				.price-buy{
					margin-top: 10px;
					span{
						color: #ff9d00;
						font-size: 24px;
						font-weight: bold;
						line-height: 40px;
					}
				}
				.view-count{
					line-height: 40px;
				}
			}
		}
	}
</style>